<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="PLATFORM_CSS/app.v1.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
<script src="PLATFORM_JS/app.v2.js"></script>
<script src="__STATIC__/js/common.js"></script>

<link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<script src="ADMIN_JS/art_dialog.source.js"></script>
<script src="ADMIN_JS/iframe_tools.source.js"></script>
<script src="__STATIC__/bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" href="PLATFORM_CSS/app.v1.css" type="text/css" />
{include file="platform/controlCommonVariable" }
<style>
.dialog-box{
	width:95%;
	margin:20px  auto;
}


</style>
</head>
<body>
<div class="dialog-box">
	<div class="row padder-v">
		<div class="col-sm-5 js-shop-block" >
				
		</div>
		<div class="col-sm-2 js-shop-block" >
				<input type="text" id='startDate' placeholder="请选择开始日期" class="input-sm form-control" onclick="WdatePicker()"/>
		</div>
		<div class="col-sm-2 js-shop-block" >
				<input type="text" id='endDate' placeholder="请选择结束日期" class="input-sm form-control" onclick="WdatePicker()" />
		</div>
		<div class="col-sm-2 js-shop-block" >
				<select name="form_type" id="form_type" class="input-sm form-control" style="color:#BBB;">
					<option value="">请选择类别</option>
					<option value="1">商城订单</option>
					<option value="2">订单退还</option>
					<option value="3">兑换</option>
					<option value="4">充值</option>
					<option value="5">签到</option>
					<option value="6">分享</option>
					<option value="7">注册</option>
					<option value="8">提现</option>
					<option value="9">提现退还</option>
					<option value="10">调整</option>
				</select>
		</div>
		<!-- <div class="col-sm-2 js-shop-block" >
				<input type="text" class="input-sm form-control" id='search_text' placeholder="请输入会员昵称" />
		</div> -->
		<div class="col-sm-1">
			<button class="btn btn-sm btn-default" type="button" onclick="LoadingInfo(1)">搜索</button>
		</div>
	</div>
	<section class="panel panel-default">
		<table class="table table-striped b-light text-sm">
			<colgroup>
					<col width="3%">
					<col width="15%">
					<col width="20%">
					<col width="20%">
					<col width="10%">
					<col width="25%">
			</colgroup>
			<thead>
				<tr>
					<th><input type="checkbox"></th>
					<th class="left">用户名</th>
					<th class="left">产生方式</th>
					<th class="left">备注</th>
					<th class="right">金额</th>
					<th class="center">创建时间</th>
				</tr>
			</thead>
			<tbody id="list">
				<tr></tr>
			</tbody>
		</table>
		<div class="padder-v b-t border-gray" style="padding-bottom: 30px;">
				<div class="col-sm-10"> </div>
				<div class="col-sm-2">总金额：<span class="gray" id="balanceSum"></span></div>
			</div>
		{include file="platform/page" /}
	</section>
</div>

<script type="text/javascript">
$(function(){
	LoadingInfo(1);
});

//查询用户列表
	function LoadingInfo(pageIndex) {
	
		var search_text = $("#search_text").val();
		var start_date = $("#startDate").val();
		var end_date = $("#endDate").val();
		var form_type = $("#form_type").val();
		
		$.ajax({
			type : "post",
			url : "{:__URL('PLATFORM_MAIN/statistics/memberAccountRecords')}",
			async : true,
			data : {
				"page_index" : pageIndex,
				"search_text":search_text, 
				"form_type":form_type, 
				"start_date":start_date, 
				"end_date":end_date,
				"type" : 2},
			success : function(data) {
				
				var html = '';
				$("#total_count_num").text(data['list']["total_count"]);
				$("#reg_person").text(data['list']['total_count']);
				$("#page_count_num").text(data['list']["page_count"]);
				$("#page_count").val(data['list']["page_count"]);
				$("#pageNumber a").remove();
				$("#balanceSum").text((data['count']).toFixed(2));
				if (data['list']["data"].length > 0) {
					for (var i = 0; i < data['list']["data"].length; i++) {
						html += '<tr>';
						html += '<td><input type="checkbox" name="sub" value="'+ data['list']['data'][i]['uid']+'"></td>';
						html += '<td>' + data['list']["data"][i]["user_name"] + '</td>';
						html += '<td>' + data['list']["data"][i]["from_type_name"] + '</td>';
						html += '<td>' + data['list']["data"][i]["text"] + '</td>';
						html += '<td class="right">' + data['list']["data"][i]["number"] + '</td>';
						html += '<td class="center">' + timeStampTurnTime(data['list']["data"][i]["create_time"]) + '</td>';
						html += '</tr>';
					}
				} else {
					html += '<tr class="center"><td colspan="6">暂无会员注册记录</td></tr>';
				}
				$("#list").html(html);
					var totalpage = $("#page_count").val();
			if (totalpage == 1) {
				changeClass("all");
			}
			var $html = pagenumShow(jumpNumber,totalpage,{$pageshow})
			$("#pageNumber").append($html);
			}
		});
	}
	$("#search_text").keypress(function(e){
		if(e.keyCode == 13){
			LoadingInfo(1);
		}
	});
	
</script>
</body>
</html>